﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="test.aspx.cs" Inherits="Mobile_test" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <script src="jquery-1.11.2.min.js"></script>
    <script src="https://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
    <script src="script/common.js"></script>
    <script src="script/wx_share.js"></script>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <input  type="text"  id ="input"/>
        </div>
        <div onclick="WeiXinShareBtn()">aaaaaaaaaaaaaaaa</div>
    </form>
    <script>
        function WeiXinShareBtn() {
            if (typeof WeixinJSBridge == "undefined") {
                alert("请先通过微信搜索 wow36kr 添加36氪为好友，通过微信分享文章 ");
            } else {
                WeixinJSBridge.invoke('shareTimeline', {
                    "title": "36氪",
                    "link": "http://www.36kr.com",
                    "desc": "关注互联网创业",
                    "img_url": "http://www.36kr.com/assets/images/apple-touch-icon.png"
                });
            }
        }
        (function () {

            if (GetRequest()["code"]) {
                var appid = "wxc074159c55beed9c";
                $("#input").val(GetRequest()["code"])
                alert(GetRequest()["code"])
                $.ajax({
                    url: "../Service/AjaxService.ashx",
                    data: {
                        code: GetRequest()["code"],
                        appid: appid,
                        userid: 100
                    },
                    cache: false,
                    dataType: "test",
                    success: function (ret) {
                        alert(ret)
                    }
                })

            }

        })()

    </script>
</body>
</html>
